<link rel="stylesheet" href="${absolutePath}/resource/css/ui-dialog.css"/>
<link rel="stylesheet" href="${absolutePath}/resource/css/public.css?version=2017121003"/>
<link rel="shortcut icon" type="image/x-icon" href="${absolutePath}/resource/images/favicon.ico">
<script src="${absolutePath}/resource/js/common/jquery-1.11.3.min.js"></script>
<script src="${absolutePath}/resource/js/common/dialog.js"></script>
<script src="${absolutePath}/resource/js/jquery.lazyload.js"></script>
<script type="text/javascript">
    var ulewo = {};
    ulewo.resultCode = {
        "SUCCESS": 200,
        "LOGINTIMEOUT": 401,
        "NOPERMISSION": 403,
        "CODEERROR": 425,
        "MOREMAXLOGINCOUNT": 405
    };
    ulewo.user = {
        userId: "<#if Session["session_user_key"]??>${session_user_key.userId}</#if>",
        userName: "<#if Session["session_user_key"]??>${session_user_key.userName}</#if>",
        userIcon: "<#if Session["session_user_key"]??>${session_user_key.userIcon}</#if>"
    }
    ulewo.sourceFrom = {
        "P": "ulewo.com",
        "A": "Android",
        "I": "iPhone"
    }

    ulewo.imageDomain = "${imageDomain}";
    ulewo.absolutePath = "${absolutePath}";
    ulewo.curUrl = window.location.href;
</script>
<script src="${absolutePath}/resource/js/common/ulewo.js?version=20160613"></script>
<script type="text/javascript">
    $(function () {
        $("img.lazy-load").lazyload({
            effect: "fadeIn"
        });
    })

    /**
     * 查看图片
     */
    $(document).on("click", ".image-thum a", function () {
        var p_con = $(this).parent();
        var imgArry = [];
        var a_images = p_con.find("a");
        var curIndex = 0;
        for (var i = 0, _len = a_images.length; i < _len; i++) {
            var img_url = a_images.eq(i).find("img").eq(0).attr("data-original")
            imgArry.push(img_url);
            if ($(this).find("img").eq(0).attr("data-original") == img_url) {
                curIndex = i;
            }
        }
        ulewo.showImage(curIndex, imgArry);
    });
    $(document).on("click", "#dialog-image-con a.dialog-image-change", function () {

        var dialogId = $(this).attr("dialogId");
        var curIndex = $(this).attr("curIndex");
        var imageArry = $(this).attr("imgArry").split(",");
        var type = $(this).attr("type");
        curIndex = parseInt(curIndex);

        if (type == "pre") {
            curIndex = curIndex - 1;
        } else if (type == "next") {
            curIndex = curIndex + 1;
        }
        if (curIndex == -1 || curIndex >= imageArry.length) {
            return;
        }
        ulewo.nextImg(dialogId, curIndex, imageArry);
    });
    $(document).on("click", ".topic-detail img,.content_detail img", function () {
        var imgsrc = $(this).attr("src");
        window.open(imgsrc);
    });
</script>
